//
//  FinishedTaskDetail.m
//  RRQS
//
//  Created by kyjun on 16/3/29.
//
//

#import "FinishedTaskDetail.h"
#import "MStore.h"
#import "OrderDetailCell.h"
#import "OrderDetailHeader.h"
#import "OrderDetailFooter.h"
#import "FinishedOrderFooter.h"

@interface FinishedTaskDetail ()<OrderDetailFooterDelegate>

@property(nonatomic,strong) UIView* headerView;
@property(nonatomic,strong) UILabel* labelOrderNO;
@property(nonatomic,strong) UIView* footerView;
@property(nonatomic,strong) UILabel* labelMark;
@property(nonatomic,strong) UIView* markView;
@property(nonatomic,strong) UIView* otherView;
/**
 *  接单时间
 */
@property(nonatomic,strong) UILabel* labelCreateDate;
/**
 *  实际取货时间
 */
@property(nonatomic,strong) UILabel* labelTakeDate;
/**
 *  实际完成时间
 */
@property(nonatomic,strong) UILabel* labelEndDate;
/**
 *  实际花费时间
 */
@property(nonatomic,strong) UILabel* labelSpendDate;


@property(nonatomic,strong) NSString* cellIdentifier;
@property(nonatomic,strong) NSString* headerIdentifier;
@property(nonatomic,strong) NSString* footerIdentitifer;

@end

@implementation FinishedTaskDetail

-(instancetype)init{
    self = [super initWithStyle:UITableViewStyleGrouped];
    if(self){
        
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"订单详情";
    
    self.cellIdentifier = @"OrderDetailCell";
    self.headerIdentifier = @"OrderDetailHeader";
    self.footerIdentitifer = @"FinishedOrderFooter";
    
    [self layoutUI];
    [self layoutConstraints];
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self refreshDataSource];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark =====================================================  User interface layout
-(void)layoutUI{
    self.headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40.f)];
    self.headerView.backgroundColor = [UIColor colorWithRed:255/255.f green:255/255.f blue:255/255.f alpha:1.0];
    [self.headerView addSubview:self.labelOrderNO];
    self.tableView.tableHeaderView = self.headerView;
    self.footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 120.f)];
    self.footerView.backgroundColor = [UIColor colorWithRed:255/255.f green:255/255.f blue:255/255.f alpha:1.0];
    CALayer* border = [[CALayer alloc]init];
    border.frame = CGRectMake(0, 39.5, SCREEN_WIDTH, 0.5);
    border.backgroundColor = [UIColor colorWithRed:231/255.0f green:231/255.0f blue:231/255.0f alpha:1.0f].CGColor;
    [self.footerView addSubview:self.markView];
    [self.markView addSubview:self.labelMark];
    [self.footerView addSubview:self.otherView];
    [self.otherView addSubview:self.labelCreateDate];
    [self.otherView addSubview:self.labelTakeDate];
    [self.otherView addSubview:self.labelEndDate];
    [self.otherView addSubview:self.labelSpendDate];
    [self.footerView.layer addSublayer:border];
    self.tableView.tableFooterView = self.footerView;
    [self.tableView registerClass:[OrderDetailCell class] forCellReuseIdentifier:self.cellIdentifier];
    [self.tableView registerClass:[OrderDetailHeader class] forHeaderFooterViewReuseIdentifier:self.headerIdentifier];
    [self.tableView registerClass:[FinishedOrderFooter class] forHeaderFooterViewReuseIdentifier:self.footerIdentitifer];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
-(void)layoutConstraints{
    self.labelOrderNO.translatesAutoresizingMaskIntoConstraints = NO;
    self.markView.translatesAutoresizingMaskIntoConstraints = NO;
    self.labelMark.translatesAutoresizingMaskIntoConstraints = NO;
    self.otherView.translatesAutoresizingMaskIntoConstraints = NO;
    self.labelCreateDate.translatesAutoresizingMaskIntoConstraints = NO;
    self.labelTakeDate.translatesAutoresizingMaskIntoConstraints = NO;
    self.labelEndDate.translatesAutoresizingMaskIntoConstraints = NO;
    self.labelSpendDate.translatesAutoresizingMaskIntoConstraints = NO;
    
    [self.labelOrderNO addConstraint:[NSLayoutConstraint constraintWithItem:self.labelOrderNO attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SCREEN_WIDTH-20.f]];
    [self.headerView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelOrderNO attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.headerView attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0.f]];
    [self.headerView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelOrderNO attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headerView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.f]];
    [self.headerView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelOrderNO attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.headerView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:10.f]];
    
    [self.markView addConstraint:[NSLayoutConstraint constraintWithItem:self.markView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SCREEN_WIDTH]];
    [self.markView addConstraint:[NSLayoutConstraint constraintWithItem:self.markView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40.f]];
    [self.footerView addConstraint:[NSLayoutConstraint constraintWithItem:self.markView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.footerView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.f]];
    [self.footerView addConstraint:[NSLayoutConstraint constraintWithItem:self.markView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.footerView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0.f]];
    
    [self.labelMark addConstraint:[NSLayoutConstraint constraintWithItem:self.labelMark attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SCREEN_WIDTH-20.f]];
    [self.markView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelMark attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.markView attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0.f]];
    [self.markView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelMark attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.markView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.f]];
    [self.markView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelMark attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.markView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:10.f]];
    
    [self.otherView addConstraint:[NSLayoutConstraint constraintWithItem:self.otherView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SCREEN_WIDTH]];
    [self.footerView addConstraint:[NSLayoutConstraint constraintWithItem:self.otherView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.markView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.f]];
    [self.footerView addConstraint:[NSLayoutConstraint constraintWithItem:self.otherView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.footerView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0.f]];
    [self.footerView addConstraint:[NSLayoutConstraint constraintWithItem:self.otherView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.footerView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.f]];
    
    [self.labelCreateDate addConstraint:[NSLayoutConstraint constraintWithItem:self.labelCreateDate attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SCREEN_WIDTH/3]];
    [self.labelCreateDate addConstraint:[NSLayoutConstraint constraintWithItem:self.labelCreateDate attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40.f]];
    [self.otherView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelCreateDate attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.otherView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.f]];
    [self.otherView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelCreateDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.otherView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0.f]];
    
    [self.labelTakeDate addConstraint:[NSLayoutConstraint constraintWithItem:self.labelTakeDate attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SCREEN_WIDTH/3]];
    [self.labelTakeDate addConstraint:[NSLayoutConstraint constraintWithItem:self.labelTakeDate attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40.f]];
    [self.otherView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelTakeDate attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.otherView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.f]];
    [self.otherView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelTakeDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.labelCreateDate attribute:NSLayoutAttributeRight multiplier:1.0 constant:0.f]];
    
    [self.labelEndDate addConstraint:[NSLayoutConstraint constraintWithItem:self.labelEndDate attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SCREEN_WIDTH/3]];
    [self.labelEndDate addConstraint:[NSLayoutConstraint constraintWithItem:self.labelEndDate attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40.f]];
    [self.otherView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelEndDate attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.otherView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.f]];
    [self.otherView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelEndDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.labelTakeDate attribute:NSLayoutAttributeRight multiplier:1.0 constant:0.f]];
    
    [self.labelSpendDate addConstraint:[NSLayoutConstraint constraintWithItem:self.labelSpendDate attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SCREEN_WIDTH]];
    [self.labelSpendDate addConstraint:[NSLayoutConstraint constraintWithItem:self.labelSpendDate attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40.f]];
    [self.otherView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelSpendDate attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.labelCreateDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.f]];
    [self.otherView addConstraint:[NSLayoutConstraint constraintWithItem:self.labelSpendDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.otherView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0.f]];
    
}
#pragma mark =====================================================  Data source
-(void)queryData{
    AFHTTPRequestOperationManager* mgr = [AFHTTPRequestOperationManager manager];
    NSDictionary* arg = @{@"ince":@"get_order_info",@"main_id":self.entity.rowID,@"emp_id":self.Identity.userInfo.userID};
    [mgr POST:kHost parameters:arg success:^(AFHTTPRequestOperation * _Nonnull operation, id  _Nonnull responseObject) {
        [WMHelper outPutJsonString:responseObject];
        NSInteger flag = [[responseObject objectForKey:@"status"]integerValue];
        if(flag == 1){
            NSDictionary* dict = [responseObject objectForKey:@"order"];
            if(![WMHelper isNULLOrnil:dict]){
                self.entity = [[MOrder alloc]initWithStore:dict];
            }
        }else{
            [self alertHUD:[responseObject objectForKey:@"fail"]];
        }
        [self loadData];
        [self.tableView reloadData];
        [self.tableView.mj_header endRefreshing];
        
    } failure:^(AFHTTPRequestOperation * _Nonnull operation, NSError * _Nonnull error) {
        [self alertHUD:@"网络异常"];
        [self.tableView.mj_header endRefreshing];
    }];
}

-(void)refreshDataSource{
    __weak typeof(self) weakSelf = self;
    self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        [weakSelf queryData];
    }];
    [self.tableView.mj_header beginRefreshing];
}
#pragma mark =====================================================  <UITableViewDataSource>

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return self.entity.arrayStore.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    MStore* empty =self.entity.arrayStore[section];
    if([empty isKindOfClass:[MStore class]])
        return empty.arrayGoods.count;
    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    OrderDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:self.cellIdentifier forIndexPath:indexPath];
    MStore* empty =self.entity.arrayStore[indexPath.section];
    cell.entity =empty.arrayGoods[indexPath.row];
    return cell;
}

#pragma mark =====================================================  <UITableVeiwDelegate>

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    MStore* empty =self.entity.arrayStore[indexPath.section];
    MFood* item =empty.arrayGoods[indexPath.row];
    CGFloat height = [WMHelper calculateTextHeight:item.foodName font:[UIFont systemFontOfSize:14.f] width:SCREEN_WIDTH*3/5];
    return height + 10.f;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 50.f;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 153.f;
}

- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    OrderDetailHeader* header =  (OrderDetailHeader*)[tableView dequeueReusableHeaderFooterViewWithIdentifier:self.headerIdentifier];
    header.backgroundColor = [UIColor blueColor];
    MStore* empty =self.entity.arrayStore[section];
    if([empty isKindOfClass:[MStore class]])
        header.entity = empty;
        return header;
}
- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    FinishedOrderFooter* footer = (FinishedOrderFooter*)[tableView dequeueReusableHeaderFooterViewWithIdentifier:self.footerIdentitifer];
    footer.backgroundColor = [UIColor redColor];
    MStore* empty =self.entity.arrayStore[section];
    if([empty isKindOfClass:[MStore class]])
        footer.entity = empty;
    footer.delegate =self;
    return footer;
}
#pragma mark =====================================================  <OrderDetailFooterDelegate>
-(void)orderDetailEnum:(EnumOrderAction)orderAction phone:(NSString *)phone{
    switch (orderAction) {
        case connectionBusiness:
        case connectionClient:
        {
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"是否拨打电话？" message:phone delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
            [alert show];
        }
            break;
        case confirmTake:
        {
            
        }
            break;
            
        default:
            break;
    }
}

#pragma mark =====================================================  <UIAlertViewDelegate>
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if(buttonIndex == 1){
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",alertView.message]]];
    }
}

#pragma mark =====================================================  private method
-(void)loadData{
    self.labelOrderNO.text = [NSString stringWithFormat:@"总订单号 : %@",self.entity.rowID];
    self.labelMark.text = [NSString stringWithFormat:@"备注 : %@",self.entity.orderMark];
    
    NSString* str = [NSString stringWithFormat:@"%@\n接单时间",self.entity.addTime];
    NSMutableAttributedString* attributeStr = [[NSMutableAttributedString alloc]initWithString:str];
    [attributeStr addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:168/255.f green:168/255.f blue:168/255.f alpha:1.0]} range:[str rangeOfString:@"接单时间"]];
    self.labelCreateDate.attributedText = attributeStr;
    
    str = [NSString stringWithFormat:@"%@\n实际取货",self.entity.getTime];
    attributeStr = [[NSMutableAttributedString alloc]initWithString:str];
    [attributeStr addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:168/255.f green:168/255.f blue:168/255.f alpha:1.0]} range:[str rangeOfString:@"实际取货"]];
    self.labelTakeDate.attributedText = attributeStr;
    
    str = [NSString stringWithFormat:@"%@\n实际完成",self.entity.sendTime];
    attributeStr = [[NSMutableAttributedString alloc]initWithString:str];
    [attributeStr addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:168/255.f green:168/255.f blue:168/255.f alpha:1.0]} range:[str rangeOfString:@"实际完成"]];
    self.labelEndDate.attributedText = attributeStr;
    
    self.labelSpendDate.text = [NSString stringWithFormat:@"配送耗时:%@分",self.entity.spendTime];
}


#pragma mark =====================================================  property package
-(MOrder *)entity{
    if(!_entity){
        _entity = [[MOrder alloc]init];
    }
    return _entity;
}

-(UILabel *)labelOrderNO{
    if(!_labelOrderNO){
        _labelOrderNO = [[UILabel alloc]init];
        _labelOrderNO.font = [UIFont systemFontOfSize:14.f];
        _labelOrderNO.textColor =[UIColor colorWithRed:152/255.f green:152/255.f blue:152/255.f alpha:1.0];
    }
    return _labelOrderNO;
}

-(UIView *)markView{
    if(!_markView){
        _markView = [[UIView alloc]init];
        _markView.backgroundColor = [UIColor whiteColor];
    }
    return _markView;
}

-(UILabel *)labelMark{
    if(!_labelMark){
        _labelMark = [[UILabel alloc]init];
        _labelMark.font = [UIFont systemFontOfSize:12.f];
        _labelMark.textColor = [UIColor colorWithRed:152/255.f green:152/255.f blue:152/255.f alpha:1.0];
    }
    return _labelMark;
}

-(UIView *)otherView{
    if(!_otherView){
        _otherView = [[UIView alloc]init];
        _otherView.backgroundColor = [UIColor whiteColor];
    }
    return _otherView;
}

-(UILabel *)labelCreateDate{
    if(!_labelCreateDate){
        _labelCreateDate = [[UILabel alloc]init];
        _labelCreateDate.lineBreakMode = NSLineBreakByCharWrapping;
        _labelCreateDate.numberOfLines = 0;
        CALayer* border = [[CALayer alloc]init];
        border.frame = CGRectMake(SCREEN_WIDTH/3-1, 10.f, 1.f, 20.f);
        border.backgroundColor = [UIColor colorWithRed:231/255.f green:231/255.f blue:231/255.f alpha:1.0].CGColor;
        [_labelCreateDate.layer addSublayer:border];
        _labelCreateDate.textAlignment = NSTextAlignmentCenter;
        _labelCreateDate.font = [UIFont systemFontOfSize:14.f];
    }
    return _labelCreateDate;
}

-(UILabel *)labelTakeDate{
    if(!_labelTakeDate){
        _labelTakeDate = [[UILabel alloc]init];
        _labelTakeDate.textAlignment = NSTextAlignmentCenter;
        _labelTakeDate.numberOfLines = 0;
        _labelTakeDate.lineBreakMode = NSLineBreakByCharWrapping;
        CALayer* border = [[CALayer alloc]init];
        border.frame = CGRectMake(SCREEN_WIDTH/3-1, 10.f, 1.f, 20.f);
        border.backgroundColor = [UIColor colorWithRed:231/255.f green:231/255.f blue:231/255.f alpha:1.0].CGColor;
        [_labelTakeDate.layer addSublayer:border];
        _labelTakeDate.font = [UIFont systemFontOfSize:14.f];
    }
    return _labelTakeDate;
}

-(UILabel *)labelEndDate{
    if(!_labelEndDate){
        _labelEndDate = [[UILabel alloc]init];
        _labelEndDate.textAlignment = NSTextAlignmentCenter;
        _labelEndDate.lineBreakMode = NSLineBreakByCharWrapping;
        _labelEndDate.numberOfLines = 0;
        _labelEndDate.font = [UIFont systemFontOfSize:14.f];
    }
    return _labelEndDate;
}

-(UILabel *)labelSpendDate{
    if(!_labelSpendDate){
        _labelSpendDate = [[UILabel alloc]init];
        _labelSpendDate.textAlignment = NSTextAlignmentCenter;
        CALayer* border = [[CALayer alloc]init];
        border.frame = CGRectMake(0, 0, SCREEN_WIDTH, 1.f);
        border.backgroundColor = [UIColor colorWithRed:231/255.f green:231/255.f blue:231/255.f alpha:1.0].CGColor;
        [_labelSpendDate.layer addSublayer:border];
        
    }
    return _labelSpendDate;
}

@end
